<template>
	<view class="content">
		<view class="search-header">
			<Search class="search" :focus="true" @confirm="onSearch"></Search>
			<label class="cancel-btn" @click="onCancelBtn">取消</label>
		</view>
		<view class="demand-list">
			<DemandItem :searchValue="searchValue" v-for="(item,i) in demandList" :key="i" :options="item"></DemandItem>
		</view>
	</view>
</template>

<script>
	import Search from '../../components/search.vue';
	import DemandItem from '../../components/demand-item.vue'
	export default {
		components:{
			Search,
			DemandItem
		},
		data(){
			return{
				searchValue:"",
				demandList:[],
			}
		},
		methods:{
			onSearch:function(e){
				console.log(e.value)
				this.searchValue = e.value;
				for (var i = 0; i <10; i++) {
					this.demandList.push({
						title:"招聘派单员",
						userName:"刘小云",
						company:"成都壹贰叁文化有限公司",
						companyIcon:"/static/images/logo.png",
						num:"2",
						time:"2021-07-28",
						typeName:"市场推广"
					})
				}
				
			},
			onCancelBtn:function(e){
				uni.navigateBack();
			}
		}
	}
</script>

<style>
	.cancel-btn{
		color: #1371FF;
		font-size: 24rpx;
		width: 88rpx;
		line-height: 56rpx;
		text-align: center;
	}
</style>
